package com.dataart.productshop.model;

import com.dataart.productshop.model.boiko.informationsystem.Kathedra;
import com.dataart.productshop.model.boiko.informationsystem.Subject;

public class FakeModel {

    private Kathedra kathedra;
    private Subject subject;
    private boolean allowedToChange;

    public FakeModel(Kathedra kathedra, boolean allowedToChange) {
        this.kathedra = kathedra;
        this.allowedToChange = allowedToChange;
    }

    public FakeModel(Subject subject, boolean allowedToChange) {
        this.subject = subject;
        this.allowedToChange = allowedToChange;
    }

    public String getName(){
        if(kathedra != null){
            return kathedra.getName();
        }
        if(subject.getName() != null){
            return subject.getName();
        }
        return "";
    }

    public boolean isAllowed(){
        return allowedToChange;
    }
}
